﻿Imports System.Web.UI

Namespace DotNetNuke.Modules.ActiveForums
    Partial Public Class af_members
        Inherits ForumBase

        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
#If SKU <> "LITE" Then
            Try
                Dim social As New Social
                If MainSettings.ProfileType = ProfileTypes.Social Then
                    Dim memberTabId As Integer = social.GetMemberTabId(PortalId)
                    If memberTabId > -1 Then
                        Response.Redirect(Utilities.NavigateUrl(memberTabId))
                    End If
                End If
            Catch ex As Exception

            End Try

#End If


            lblHeader.Text = Utilities.GetSharedResource("[RESX:MemberDirectory]")
            Dim bCanLoad As Boolean = False
            Dim sMode As String = MainSettings.MemberListMode
            If Not UserInfo.IsSuperUser Then
                If sMode = "DISABLED" Then
                    Response.Redirect(NavigateUrl(TabId))
                End If
                If Not Request.IsAuthenticated And (sMode = "ENABLEDREG" Or sMode = "ENABLEDMOD") Then
                    Response.Redirect(NavigateUrl(TabId))
                ElseIf Request.IsAuthenticated And sMode = "ENABLEDMOD" And Not UserIsMod Then
                    Response.Redirect(NavigateUrl(TabId))
                End If
            End If

            Dim ctl As SettingsBase = Nothing
            ctl = CType(New DotNetNuke.Modules.ActiveForums.Controls.Members, SettingsBase)
            ctl.ModuleConfiguration = Me.ModuleConfiguration
            If Not Me.Params = String.Empty Then
                ctl.Params = Me.Params
            End If
            Environment.UpdateMeta(Me.BasePage, "[VALUE] - " & lblHeader.Text, "[VALUE]", "[VALUE]")
            plhMembers.Controls.Add(ctl)


        End Sub

    End Class
End Namespace
